/* GUI CONVERTED from rmpvrp01.p (converter v1.76) Tue May 13 01:33:38 2003 */
/* rmpvrp01.p - SUPPLIER MASTER REPORT                                      */
/* Copyright 1986-2003 QAD Inc., Carpinteria, CA, USA.                      */
/* All rights reserved worldwide.  This is an unpublished work.             */
/* $Revision: 1.12.1.15 $                                                */
/*V8:ConvertMode=FullGUIReport                                              */
/* REVISION: 1.0      LAST MODIFIED: 04/09/86   BY: PML                     */
/* REVISION: 7.0      LAST MODIFIED: 01/27/92   BY: MLV *F098*              */
/* REVISION: 7.0      LAST MODIFIED: 08/11/92   BY: tjs *G027*              */
/* REVISION: 7.3      LAST MODIFIED: 10/23/92   BY: jjs *G226*              */
/* REVISION: 7.4      LAST MODIFIED: 08/25/93   BY: tjs *H082*              */
/* REVISION: 7.4      LAST MODIFIED: 10/15/93   BY: jjs *H181*              */
/* REVISION: 7.4      LAST MODIFIED: 10/18/93   BY: cdt *H086*              */
/* REVISION: 8.5      LAST MODIFIED: 07/11/95   BY: CDT *J057*              */
/* REVISION: 8.5      LAST MODIFIED: 01/30/96   BY: *J0CV* Robert Wachowicz */
/* REVISION: 8.5      LAST MODIFIED: 10/21/96   BY: rxm *H0NC*              */
/* REVISION: 8.5      LAST MODIFIED: 02/25/97   BY: *H0SQ* Suresh Nayak     */
/* REVISION: 8.6      LAST MODIFIED: 03/10/97   BY: *K074* Arul Victoria    */
/* REVISION: 8.6      LAST MODIFIED: 10/11/97   BY: GYK *K0SS*              */
/* REVISION: 8.6      LAST MODIFIED: 10/29/97   BY: *H1G4* Manish K.        */
/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane        */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan       */
/* REVISION: 9.0      LAST MODIFIED: 03/10/99   BY: *M0B3* Michael Amaladhas */
/* REVISION: 9.0      LAST MODIFIED: 03/13/99   BY: *M0BD* Alfred Tan       */
/* REVISION: 9.1      LAST MODIFIED: 10/01/99   BY: *N014* Paul Johnson     */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1      LAST MODIFIED: 05/05/00   BY: *N09X* Antony Babu      */
/* REVISION: 9.1      LAST MODIFIED: 08/11/00   BY: *N0KK* jyn              */
/* REVISION: 9.1      LAST MODIFIED: 09/13/00   BY: *N0VR* Mudit Mehta      */
/* Old ECO marker removed, but no ECO header exists *F002*                  */
/* Old ECO marker removed, but no ECO header exists *F037*                  */
/* Old ECO marker removed, but no ECO header exists *F0PN*                  */
/* Revision: 1.12.1.8     BY: Katie Hilbert   DATE: 04/01/01 ECO: *P002* */
/* Revision: 1.12.1.9     BY: Ed van de Gevel DATE: 11/05/01  ECO: *N15L*  */
/* Revision: 1.12.1.11    BY: Nikita Joshi    DATE: 03/20/02  ECO: *N1DT*  */
/* Revision: 1.12.1.14    BY: Steve Nugent    DATE: 10/07/02  ECO: *P0J1*  */
/* $Revision: 1.12.1.15 $   BY: Narathip W.     DATE: 05/03/03  ECO: *P0R5*  */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/
/* DISPLAY TITLE */

/*GUI global preprocessor directive settings */
&GLOBAL-DEFINE PP_PGM_RP TRUE
&GLOBAL-DEFINE PP_ENV_GUI TRUE


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

{mfdtitle.i "2+ "}
{cxcustom.i "rmpvrp01.P"}

{&rmpvrp01-P-TAG1}

{pxmaint.i}

define variable code like pv_addr.
define variable code1 like pv_addr.
define variable name like ad_name.
define variable name1 like ad_name.
define variable zip like ad_zip.
define variable zip1 like ad_zip.
define variable buyer like pv_buyer.
define variable buyer1 like pv_buyer.

define variable under as character format "x(132)".
define variable vdtype like pv_type.
define variable vdtype1 like pv_type.
define variable tid_notice as character format "x(1)" label "TID Notice".
define variable bk_acct_type like csbd_type.
define variable bk_acct_type_desc like glt_desc.
{&rmpvrp01-P-TAG7}
define variable l_pv_email as character format "x(40)" no-undo.

{&rmpvrp01-P-TAG8}

/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
   
 RECT-FRAME       AT ROW 1.4 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1   COLUMN 3 NO-LABEL
 SKIP(.1)  /*GUI*/
code           colon 16
   code1          label {t001.i} colon 49 skip
   name           colon 16
   name1          label {t001.i} colon 49 skip
   vdtype         colon 16
   vdtype1        label {t001.i} colon 49 skip
   zip            colon 16
   zip1           label {t001.i} colon 49 skip
   buyer          colon 16
   buyer1         label {t001.i} colon 49 skip
 SKIP(.4)  /*GUI*/
with frame a side-labels width 80 NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER.
 F-a-title = &IF (DEFINED(SELECTION_CRITERIA) = 0)
  &THEN " Selection Criteria "
  &ELSE {&SELECTION_CRITERIA}
  &ENDIF .
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:WIDTH-PIXELS in frame a =
  FONT-TABLE:GET-TEXT-WIDTH-PIXELS(
  RECT-FRAME-LABEL:SCREEN-VALUE in frame a + " ", RECT-FRAME-LABEL:FONT).
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5. /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME


{&rmpvrp01-P-TAG9}

/* SET EXTERNAL LABELS */
setFrameLabels(frame a:handle).

under = dynamic-function('getTermLabelFillCentered' in h-label,
   input "SUPPLIER_ADDRESS",
   input 132,
   input "=").

FORM /*GUI*/ 
   csbd_bank
   bk_acct_type
   csbd_edi
   csbd_branch
   csbd_bk_acct format "x(24)"
   csbd_beg_date
   csbd_end_date
with STREAM-IO /*GUI*/  down frame csbd width 132
   title color normal (getFrameTitle("BANK_ACCOUNTS_DATA",26)).

/* SET EXTERNAL LABELS */
setFrameLabels(frame csbd:handle).

{wbrp01.i}

/*GUI*/ {mfguirpa.i true "printer" 132 " " " " " "  }

/*GUI repeat : */
/*GUI*/ procedure p-enable-ui:

   if code1 = hi_char then code1 = "".
   if name1 = hi_char then name1 = "".
   if buyer1 = hi_char then buyer1 = "".
   if zip1 = hi_char then zip1 = "".
   if vdtype1 = hi_char then vdtype1 = "".

   if c-application-mode <> 'web' then
   {&rmpvrp01-P-TAG10}
   
run p-action-fields (input "display").
run p-action-fields (input "enable").
end procedure. /* p-enable-ui, replacement of Data-Entry GUI*/

/*GUI*/ procedure p-report-quote:


   {wbrp06.i &command = update &fields = "  code code1 name name1 vdtype
        vdtype1 zip zip1 buyer buyer1" &frm = "a"}

   {&rmpvrp01-P-TAG11}
   if (c-application-mode <> 'web') or
      (c-application-mode = 'web' and
      (c-web-request begins 'data')) then do:

      bcdparm = "".
      {mfquoter.i code       }
      {mfquoter.i code1      }
      {mfquoter.i name       }
      {mfquoter.i name1      }
      {mfquoter.i vdtype     }
      {mfquoter.i vdtype1    }
      {mfquoter.i zip        }
      {mfquoter.i zip1       }
      {mfquoter.i buyer      }
      {mfquoter.i buyer1     }
      {&rmpvrp01-P-TAG12}

      if code1 = "" then code1 = hi_char.
      if name1 = "" then name1 = hi_char.
      if buyer1 = "" then buyer1 = hi_char.
      if zip1 = "" then zip1 = hi_char.
      if vdtype1 = "" then vdtype1 = hi_char.

   end.

   /* OUTPUT DESTINATION SELECTION */
   
/*GUI*/ end procedure. /* p-report-quote */
/*GUI - Field Trigger Section */

/*GUI MFSELxxx removed*/
/*GUI*/ procedure p-report:
/*GUI*/   {gpprtrpa.i "printer" 132 " " " " " " " " }
/*GUI*/   mainloop: do on error undo, return error on endkey undo, return error:




   {mfphead.i}

   /* USE FORMS AND DISPLAY FROM SUPPLIER MAINTENANCE */

   /* DISPLAY SELECTION FORM */

   {&rmpvrp01-P-TAG13}
   FORM /*GUI*/ 
      skip
      pv_addr        colon 16
      ad_temp        colon 52
      ad_name        colon 16
      ad_line1       colon 16
      ad_line2       colon 16
      ad_line3       colon 16
      ad_city        colon 16
      ad_state       colon 52
      ad_zip         colon 78
      ad_country     colon 16
      ad_ctry        colon 52 no-label
      ad_county      colon 78
      ad_attn        colon 16
      ad_attn2       label "[2]" colon 52
      ad_phone       colon 16
      ad_ext                           
      ad_phone2      label "[2]" colon 52
      ad_ext2        colon 78
      ad_fax         colon 16
      ad_fax2        label "[2]" colon 52
      ad_date        colon 78
   with STREAM-IO /*GUI*/  frame a1 title color normal under side-labels
      width 132 attr-space.
   {&rmpvrp01-P-TAG14}

   /* SET EXTERNAL LABELS */
   setFrameLabels(frame a1:handle).

   FORM /*GUI*/ 
      skip
      l_pv_email label "E-mail"
   with STREAM-IO /*GUI*/  frame email title color normal
   (getFrameTitle("SUPPLIER_PERFORMANCE_E-MAIL",32)) side-labels
   width 132 attr-space.

   /* SET EXTERNAL LABELS */
   setFrameLabels(frame email:handle).

   /* Rearranged and split frame b into frame b1. */

   {&rmpvrp01-P-TAG2}
   FORM /*GUI*/ 
      pv_sort        colon 16
      pv_bank        colon 52
      pv_ckfrm       colon 78
      pv_type        colon 16
      pv_curr        colon 52
      pv_lang        colon 78
      pv_pur_acct    colon 16 space(1)
      pv_pur_sub     no-label space(1)
      pv_pur_cc      no-label
      pv_pur_cntct   colon 78
      pv_ap_acct     colon 16 space(1)
      pv_ap_sub      no-label space(1)
      pv_ap_cc       no-label
      pv_ap_cntct    colon 78
      pv_shipvia     colon 16
      pv_promo       colon 52
      pv_rmks        colon 16
   with STREAM-IO /*GUI*/  frame b title color normal (getFrameTitle("PRESUPPLIER_DATA",20))
      side-labels
      width 132 attr-space.
   {&rmpvrp01-P-TAG3}

   /* SET EXTERNAL LABELS */
   setFrameLabels(frame b:handle).
   {&rmpvrp01-P-TAG4}

   FORM /*GUI*/ 
      pv_buyer       colon 16
      pv_pr_list2    colon 16
      pv_pr_list     colon 16
      pv_fix_pr      colon 16
   with STREAM-IO /*GUI*/  frame b1 title color normal
      (getFrameTitle("SUPPLIER_PRICING_DATA",30)) side-labels
      width 132 attr-space.

   /* SET EXTERNAL LABELS */
   setFrameLabels(frame b1:handle).

   FORM /*GUI*/ 
      pv_rcv_so_price    colon 25
      pv_rcv_held_so     colon 25
      pv_tp_pct          colon 25
      pv_tp_use_pct      colon 25
   with STREAM-IO /*GUI*/  frame b2 title color normal
      (getFrameTitle("ENTERPRISE_MATERIAL_TRANSFER_DATA",46))

      side-labels width 132 attr-space.

   /* SET EXTERNAL LABELS */
   setFrameLabels(frame b2:handle).

   FORM /*GUI*/ 
      pv_cr_terms    colon 16
      pv_taxable     colon 56
      pv_disc_pct    colon 16
      pv_tax_id      colon 56 format "x(18)"
      tid_notice     colon 56
      ad_coc_reg     colon 16
      pv_debtor      colon 56
      pv_partial     colon 16
      pv_1099        colon 56
      pv_hold        colon 16
      pv_pay_spec    colon 56
   with STREAM-IO /*GUI*/  frame c title color normal
      (getFrameTitle("SUPPLIER_TERMS_DATA",28))
      side-labels width 132 attr-space.

   /* SET EXTERNAL LABELS */
   setFrameLabels(frame c:handle).

   /* DEFINE FORM FOR ERS DATA TO APPEAR ON REPORT */
   FORM /*GUI*/ 
      ers_opt       colon 16
      ers_pr_lst_tp colon 56
   with STREAM-IO /*GUI*/  frame d title color normal
      (getFrameTitle("EVALUATED_RECEIPTS_SETTLEMENT_DATA",47))
      side-labels width 132 attr-space.

   /* SET EXTERNAL LABELS */
   setFrameLabels(frame d:handle).
   {&rmpvrp01-P-TAG5}

   {&rmpvrp01-P-TAG15}
   for each pv_mstr where (pv_addr >= code and pv_addr <= code1)
         and (pv_sort >= name and pv_sort <= name1)
         and (pv_buyer >= buyer and pv_buyer <= buyer1)
         and (pv_type >= vdtype and pv_type <= vdtype1)
      no-lock by pv_sort:

      find ad_mstr where ad_addr = pv_addr no-lock no-error.

      if available ad_mstr and (ad_zip >= zip and ad_zip <= zip1)
      then do:

         display pv_addr ad_temp ad_name ad_line1 ad_line2 ad_line3 ad_city
            ad_state ad_zip ad_attn ad_phone ad_ext ad_date ad_country
            ad_ctry
            ad_county ad_attn2 ad_phone2 ad_ext2 ad_fax ad_fax2
            ad_date with frame a1 STREAM-IO /*GUI*/ .

         if {pxfunct.i
            &FUNCTION='isSupplierPerformanceEnabled'
            &PROGRAM='adsuxr.p'}
         then do:
            {pxrun.i
               &PROC='getEmailID'
               &PROGRAM='adsuxr.p'
               &PARAM="(input pv_addr,
                        output l_pv_email)"}
            display
               l_pv_email
            with frame email STREAM-IO /*GUI*/ .

         end. /* IF {pxfunct.i .... */

         display
            pv_sort pv_ap_acct
            pv_ap_sub
            pv_ap_cc pv_pur_acct
            pv_pur_sub
            pv_pur_cc pv_shipvia pv_rmks  pv_type
            pv_ckfrm pv_bank pv_pur_cntct pv_ap_cntct  pv_curr pv_lang
            pv_promo
         with frame b STREAM-IO /*GUI*/ .

         display
            pv_buyer pv_pr_list2 pv_pr_list pv_fix_pr
         with frame b1 STREAM-IO /*GUI*/ .

         display
            pv_rcv_so_price pv_rcv_held_so pv_tp_pct pv_tp_use_pct
         with frame b2 STREAM-IO /*GUI*/ .

         find qad_wkfl where qad_key1 = "advnmt.p" and qad_key2 = pv_addr
         no-lock no-error.
         if available qad_wkfl then tid_notice = qad_charfld[1].
         else tid_notice = "".

         display
            pv_cr_terms
            pv_disc_pct pv_partial
            ad_gst_id @ pv_tax_id
            ad_taxable @ pv_taxable
            tid_notice
            pv_1099
            ad_coc_reg
            pv_debtor
            pv_hold
            pv_pay_spec
         with frame c STREAM-IO /*GUI*/ .

         /*DISPLAY ERS DATA*/
         find ers_mstr where ers_vend = pv_addr
            and ers_site = ""
            and ers_part = "" no-lock no-error.
         if available ers_mstr then
            display ers_opt ers_pr_lst_tp with frame d STREAM-IO /*GUI*/ .

         {&rmpvrp01-P-TAG6}
         /*DISPLAY ALL BANK ACCOUNTS FOR CUSTOMER */
         for each csbd_det where csbd_addr = pv_addr no-lock:
            /* GET MNEMONIC FOR ACCOUNT TYPE FROM lngd_det */
            {gplngn2a.i &file     = ""csbd_det""
               &field    = ""bk_acct_type""
               &code     = csbd_type
               &mnemonic = bk_acct_type
               &label    = bk_acct_type_desc}

            display csbd_bank
               bk_acct_type
               csbd_edi
               csbd_branch
               csbd_bk_acct
               csbd_beg_date
               csbd_end_date when (csbd_end_date <> hi_date)
               "" when (csbd_end_date = hi_date) @ csbd_end_date
            with frame csbd STREAM-IO /*GUI*/ .
            down 1 with frame csbd.

            /* ALLOW USER TO EXIT IF F4 PRESSED OR MAX LINE/PAGE REACHED */
            
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/

         end.
         {&rmpvrp01-P-TAG16}

      end.
      
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/

   end.

   /* REPORT TRAILER  */

   
/*GUI*/ {mfguitrl.i} /*Replace mfrtrail*/

/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/


end.

{wbrp04.i &frame-spec = a}

/*GUI*/ end procedure. /*p-report*/
/*GUI*/ {mfguirpb.i &flds=" code code1 name name1 vdtype vdtype1 zip zip1 buyer buyer1 "} /*Drive the Report*/
